import React, {useState, useEffect} from 'react'

// 如何实现模拟的数据接口请求功能
function useLoadData () {
  const [num, setNum] = useState(1)

  useEffect(() => {
    setTimeout(() => {
      setNum(2)
    }, 1000)
  },[])

  return [
    num,
    setNum
  ]
}

export default useLoadData